<template>
  <div class="gonge_wrapper">
    <GongeItem v-for="item in state" :key="item.id" :data="item" />
  </div>
</template>

<script>
import { onBeforeMount, reactive } from "vue";
import GongeItem from "@/components/GongeItem/index.vue";
import request from "@/api//default.js";
export default {
  components: {
    GongeItem,
  },
  setup() {
    let state = reactive([]);
    onBeforeMount(async () => {
      const data = await request("/gongge");
      state.push(...data.data);
    });

    return {
      state,
    };
  },
};
</script>

<style scoped>
.gonge_wrapper {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, 1fr);
  background: white;
  margin-top: 20px;
  padding: 10px;
}
</style>